/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 三石
 * Date: 2022-05-25
 * Time: 22:09
 */
public class Date {
    public int year;
    public int month;
    public int day;
    public void setDate(int y, int m, int d){
        year=y;
        month=m;
        day=d;
    }

    public void printDate(){
        System.out.println(year+" "+month+" "+day);
    }

    public Date(){
        this(2022,5,26);
        System.out.println("不带参数的构造方法！");
    }
    public Date(int year,int month, int day){
        this.year=year;
        this.month=month;
        this.day=day;
        System.out.println("带有参数的构造方法！");
    }

    public static void main(String[] args) {
        Date date1=new Date();
        date1.printDate();
    }

    public static void main1(String[] args) {
        Date date1=new Date();
        date1.setDate(2021,12,25);
        date1.printDate();

        Date date2=new Date();
        date2.setDate(2022,5,25);
        date2.printDate();
    }
}
